<template>
	<view>
		<view class="text-card">
			<view class="item">
				<view class="label">
					<text>运单编号</text>
				</view>
				<view class="content">
					<text>{{info.billNo}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>派发人</text>
				</view>
				<view class="content">
					<text>{{info.creatorName}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>派发时间</text>
				</view>
				<view class="content">
					<text>{{info.createTime&&info.createTime.replace('T',' ')}}</text>
				</view>
			</view>
		</view>
	<view class="text-card" v-for="(item ,index) in billExtendInfoVOList" >
		<view class="item">
			<view class="label">
				<text>托运人</text>
			</view>
			<view class="content">
				<text>{{item.consignSquareName}}</text>
			</view>
		</view>
		<view class="item">
			<view class="label">
				<text>联系电话</text>
			</view>
			<view class="content">
				<text>{{item.consignSquareTel}}</text>
			</view>
		</view>
	</view>
		<view class="text-card" v-for="(item ,index) in loadingGoodsList" :key="item.id">
			<view class="item">
				<view class="label">
					<text>装货方{{loadingGoodsList.length>1?(index+1):''}}</text>
				</view>
				<view class="content">
					<text>{{item.comName}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>联系电话</text>
				</view>
				<view class="content">
					<text>{{item.contactsTel}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>装货地址</text>
				</view>
				<view class="content">
					<text>{{item.addr}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>装货时间</text>
				</view>
				<view class="content">
					<text>{{info.loadingDate&&info.loadingDate.replace('T',' ')}}</text>
				</view>
			</view>
		</view>
		<view class="text-card" v-for="(item ,index) in unloadingGoodsList" :key="item.id">
			<view class="item">
				<view class="label">
					<text>收货方{{unloadingGoodsList.length>1?(index+1):''}}</text>
				</view>
				<view class="content">
					<text>{{item.comName}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>联系电话</text>
				</view>
				<view class="content">
					<text>{{item.contactsTel}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>收货地址</text>
				</view>
				<view class="content">
					<text>{{item.addr}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>收货时间</text>
				</view>
				<view class="content">
					<!-- <text>{{info.unloadingDate&&item.unloadingDate.replace('T',' ')}}</text> -->
					<text>{{info.unloadingDate&&info.unloadingDate.replace('T',' ')}}</text>
				</view>
			</view>
		</view>
		<view class="text-card">
			<view class="item">
				<view class="label">
					<text>承运人</text>
				</view>
				<view class="content">
					<text>{{info.carriageName}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>联系电话</text>
				</view>
				<view class="content">
					<text>{{info.carriageTel}}</text>
				</view>
			</view>
			<view class="item" span="2">
				<view class="label">
					<text>驾驶人员</text>
				</view>
				<view class="content">
					<text>{{info.driverName}}</text>
				</view>
			</view>
			<view class="item" span="2">
				<view class="label">
					<text>押运人员</text>
				</view>
				<view class="content">
					<text>{{info.escortName}}</text>
				</view>
			</view>
			<view class="item" span="2">
				<view class="label">
					<text>车辆号牌</text>
				</view>
				<view class="content">
					<text>{{info.vehCode}}</text>
				</view>
			</view>
			<view class="item" span="2" v-if="info.trailerVehCode">
				<view class="label">
					<text>挂车号牌</text>
				</view>
				<view class="content">
					<text>{{info.trailerVehCode}}</text>
				</view>
			</view>
		</view>
		<view class="text-card">
			<view class="item">
				<view class="label">
					<text>货物信息</text>
				</view>
				<view class="content">
					<text>{{info.goodsInfo}}</text>
				</view>
			</view>
			<view class="item">
				<view class="label">
					<text>线路信息</text>
				</view>
				<view class="content">
					<text>{{info.lineName}}</text>
				</view>
			</view>
		</view>
		<view class="text-card" v-if="info.approvalState == 1 || info.approvalResult == 1">
			<view class="item">
				<view class="label"><text>取消原因</text></view>
				<view class="content">
					<text>{{info.cancelReason}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['info'],
		computed: {
			loadingGoodsList() {
				const list = this.info.busiTaskaddrList;
				if (!list || list.length == 0) {
					return [];
				}
				return list.filter((item) => item.addrType != 2)
			},
			unloadingGoodsList() {
				const list = this.info.busiTaskaddrList;
				if (!list || list.length == 0) {
					return [];
				}
				return list.filter((item) => item.addrType == 2)
			},
			billExtendInfoVOList() {
				const list = this.info.consignList;
				if (!list || list.length == 0) {
					return [];
				}
				return list
			},
		}
	}
</script>

<style lang="scss" scoped>
	.text-card {
		margin-bottom: 20rpx;
	}
</style>
